package graphic;

import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * @program: javaLearn
 * @description:
 * @author: renhai
 * @Date ：2021/12/21 0:07
 **/
public class MyMouseListener2 extends MouseAdapter {
    Container c;
    public MyMouseListener2( Container c)
    {
        this.c=c;
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        c.setBackground(Color.red);
    }

    @Override
    public void mouseExited(MouseEvent e) {
        c.setBackground(Color.white);
    }
}
